// 可读、可写、双工、转化流（压缩）

let fs = require('fs');

let path = require('path')

let rs = fs.createReadStream(path.resolve(__dirname,'name.txt'),{
  flags:'r',//r w
  highWaterMark:5,
  encoding:'utf8',//默认null buffer
  autoClose:true,
  start:0,
  // end:5,//slice(start,end)
});

rs.on('data',(chunk)=>{
  console.log(chunk)
  rs.pause();
  rs.resume();
})
rs.on('end',()=>{
  console.log('end')
})
